<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head th:include="include :: header"></head>
<head>
    <style type="text/css">
        .td-left {
            text-align: left !important;
            padding-left: 5px;
        }

        .td-checkbox {
            vertical-align: middle;
            margin-top: 0px !important;
        }

        .td-label {
            vertical-align: middle;
            margin-bottom: 0px;
        }

        .td-radio {
            width: 13px !important;
            height: 13px !important;
            vertical-align: middle;
            margin-top: 0px !important;
        }

    </style>
</head>

<body class="hold-transition skin-blue sidebar-mini">
<section class="content-header">
    <h1 style="padding-left: 40px">变更通知单</h1>
</section>
<section class="content"style="padding: 2px 50px 20px 50px">
    <div class="box">
        <div class="box-body">
        <form id="sheetForm" class="form-horizontal">
            <input name = "proChangeId" th:value="${proChangeId}" type="hidden">
            <div class="col-xs-8 col-xs-push-2">
                <table class="t1">
                    <thead>
                    <tr>
                        <td colspan="6">
                            <img th:src="@{/img/logo3.jpg}" width="40px" height="40px" style="margin-top: -30px">
                            <div style="display: inline-block;margin-top: 5px;margin-left: 5px">
                                <span style="letter-spacing: 10px; display: block; line-height: 20px">&nbsp;辽宁忠旺机械设备制造有限公司</span>
                                <span style="display: block; font-size: 8px; letter-spacing: 1px; line-height: 20px">Liaoning Zhongwang Machinery Equipment Manufacturing Co., Ltd.</span>
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="6"
                            style="font-size: 26px;font-weight: bold; letter-spacing: 4px; line-height: 45px">
                            变更通知单
                        </td>
                    </tr>
                    </thead>
                    <tbody id="out">
                    <tr>
                        <td style="width: 12%; font-size: 14px;font-weight: bold">项目编号</td>
                        <td style="width: 12%; font-size: 14px;font-weight: bold">
                            [[${projectChgInfo.proCode}]]
                        </td>
                        <td style="width: 12%; font-size: 14px;font-weight: bold">项目名称</td>
                        <td style="width: 40%; font-size: 14px;font-weight: bold">
                            [[${projectChgInfo.proName}]]
                        </td>
                        <td style="width: 12%; font-size: 14px;font-weight: bold">数量</td>
                        <td style="width: 12%; font-size: 14px;font-weight: bold">
                            [[${projectChgInfo.proQty}]]
                        </td>
                    </tr>
                    <tr>
                        <td colspan="6" style="line-height: 200%">
                                <textarea name="chgContent" class="form-control"
                                          th:text="${projectChgInfo.chgContent}"
                                          style="text-align: left; max-width: 100%; min-width: 100%; max-height: 500px; min-height: 500px;  font-size: 15px; line-height: 150%; border: 1px solid #dddddd; padding: 10px;resize: none;">
                                </textarea>
                        </td>
                    </tr>
                    <tr>
                        <td style="font-weight: bold;font-size: 14px">
                            上传文件：
                        </td>
                        <td  colspan="5"style="text-align: left;padding-left: 5px">
                            <span shiro:hasPermission="overview:projectChangeQuery:download" th:if="${preFiles != null}" th:each="preFiles: ${preFiles}" th:id="${preFiles.id}" name="preFiles">
                                <a shiro:hasPermission="overview:projectChangeQuery:download" th:href="@{'/proChangeQuery/downloadFile/'+${preFiles.id}}" target="pdfContainer" onclick="showPdf(true)" th:text="${preFiles.fileName + '&ensp;&ensp;'}"
                                   th:style="'color:'+ ${preFiles.changeFlg == 1?'#dd4b39':'' +''}"></a>
                            </span>
                        </td>
                    </tr>
                    <tr>
                        <td style="font-weight: 14px; text-align: right; padding-right: 10px;line-height: 250%"
                            colspan="6">
                            [[${'变更日期：'+ #dates.format(projectChgInfo.createDate, 'yyyy-MM-dd')}]]
                        </td>
                    </tr>
                    </tbody>
                </table>
<!--                <button type="button" class="btn btn-info pull-right" id="btn-save-info"-->
<!--                        style="margin-top: 8px;">-->
<!--                    <span class="Bold">保存</span>-->
<!--                </button>-->
            </div>
        </form>
        </div>
    </div>
</section>
<div th:include="include :: footer"></div>
<script th:inline="javascript">
    /** 替换特殊字符 */
    function toTextarea(str) {
        var reg = new RegExp("<br>", "g");
        var regSpace = new RegExp("&ensp;", "g");
        str = str.replace(reg, "\n");
        str = str.replace(regSpace, " ");
        return str;
    }

    $(function () {
        /** 将textarea内的信息显示为字符串 */
        var str = $("#sheetForm textarea[name ='chgContent']").val();
        $("#sheetForm textarea[name ='chgContent']").val(toTextarea(str));


    })
</script>
</body>
</html>
